import random
import time

import conftest
from common.core.enu import ContentTypeEnu

# ContentType: ...
json_type = ContentTypeEnu.json_type.value
form_type = ContentTypeEnu.form_type.value
accept = "application/json, text/plain, */*"


# 外部函数引用
def get_host():
    # 不同的host策略，测试 UAT
    return "http://192.168.31.108"


# 全局token
def app_token():
    return conftest.TOKEN


def today_start():
    return time.strftime("%Y-%m-%d 00:00:00", time.localtime())


def today_end():
    return time.strftime("%Y-%m-%d 23:59:59", time.localtime())


def random_int(start, end):
    random.randint(start, end)